package com.alibaba.dubbo.demo;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Consumer {
	public static void main(String[] args) throws Exception {
		String s[] = System.getProperty("java.class.path").split(";");
		for (String string : s) {
			System.out.println(string);
		}

		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] { "dubbo-demo-consumer.xml" });
		context.start();
		DemoService demoService = (DemoService) context.getBean("demoService"); // obtain proxy object  for remote invocation
		
		String hello = demoService.sayHello("world"); // execute remote invocation
		System.out.println(hello); // show the result
		
		context.close();
		context.stop();
		context.destroy();
		context=null;
		System.out.println("end");
//		System.exit(0);
	}
}
